#include <SDL.h>
#include <stdlib.h>
#include <stdio.h>
void  barre(SDL_Surface *ecran, int* boucle)
{
    SDL_Surface *barre = NULL;
    static SDL_Rect position;
    SDL_Event event;
    position.y = 440;
    barre = SDL_CreateRGBSurface(SDL_HWSURFACE, 150, 35, 32, 0, 0, 0, 0);
    SDL_FillRect(barre, NULL, SDL_MapRGB(ecran->format, 0, 0, 0));

    SDL_EnableKeyRepeat(1, 1);

    SDL_PollEvent(&event);
    switch(event.type)
    {
      case SDL_MOUSEMOTION:

      position.x = event.motion.x -75;
      position.y = 440;
      break;
      case SDL_QUIT:
      *boucle = NULL;
      break;
    }
    SDL_FillRect(ecran, NULL, SDL_MapRGB(ecran->format, 116, 251, 70));
    SDL_BlitSurface(barre, NULL, ecran, &position);
    return position;
}


